{include file="public/header" /}

<div class="aw-container-wrap">
	<div class="container aw-publish">
		<div class="row">
			<div class="aw-content-wrap clearfix">
				<div class="col-sm-12 col-md-9 aw-main-content">
					<!-- tab 切换 -->
					<ul class="nav nav-tabs aw-nav-tabs active">
						
						<!-- <li><a href="project/publish/">活动</a></li>
						<li><a href="ticket/publish/">工单</a></li> -->
						<li><a href="{:url('post/publish/article')}">文章</a></li>
						<li class="active"><a href="{:url('post/publish/question')}">问题</a></li>
						<h2 class="hidden-xs"><i class="icon icon-ask"></i> 问题</h2>
					</ul>
					<!-- end tab 切换 -->
					<form action="{:url('ajax/question/edit')}" method="post" class="cmzForm" onsubmit="return false;">
						
						
						<div class="aw-mod aw-mod-publish">
							<div class="mod-body">
								<h3>问题标题:</h3>
								<!-- 问题标题 -->
								<div class="aw-publish-title">
									<input type="text" name="question_content" value="{$question_content}" class="form-control" placeholder="问题标题..." />
								
									
								<div class="dropdown">
										<select name="category_id" id="" class="form-control">
												<option value="">选择分类</option>
												<?php foreach ($category as  $v): ?>
												<option {if condition="$v['id']==$category_id"} selected="" {/if}value="{$v.id}" value="{$v.id}">{$v.title}</option>
											<?php endforeach ?>
											</select>
									
								
								</div>
								</div>

								
								<!-- end 问题标题 -->

								<h3><?php e('问题补充 (选填)'); ?>:</h3>
								<div class="aw-mod aw-editor-box">
									<div class="mod-head">
										<div class="wmd-panel">
										<script type="text/javascript" src="/static/plus/js/plugins/ueditor/ueditor.config.js"></script>
					                        <script type="text/javascript" src="/static/plus/js/plugins/ueditor/ueditor.all.js"></script>
					                        <script type="text/javascript" src="/static/plus/js/plugins/ueditor/ueditor.parse.js"></script>
					                        <textarea name="question_detail" class="question_detail-baiduedit"  style="display:none;">{$question_detail}</textarea>
					                         <script id="question_detail" type="text/plain" style="300">{$question_detail}</script>
					                        <script type="text/javascript">
					                            var ue = UE.getEditor("question_detail");
					                            ue.addListener( "selectionchange", function () {
					                                $(".question_detail-baiduedit").val(ue.getContent())
					                               
					                            } );
					                            
					                       </script>
								           
								        </div>
									</div>
									<!-- <div class="mod-body">
										<span class="pull-right text-color-999" id="question_detail_message">&nbsp;</span>
										
										<div class="aw-upload-box">
											<a class="btn btn-default">上传附件</a>
											<div class="upload-container"></div>
											<span class="text-color-999 aw-upload-tips hidden-xs"><?php e('允许'); ?> : </span>
										</div>
										
									</div> -->
								</div>
								<?php if (!$this->question_info['question_id']) { ?>
								<h3><?php e('添加话题'); ?>:</h3>
								<div class="aw-topic-bar" data-type="publish">
									<div class="tag-bar clearfix">
										<?php if ($_GET['topic_title']) { ?>
										<span class="topic-tag">
											<a class="text"><?php echo urldecode($_GET['topic_title']); ?></a>
											<a class="close" >
												<i class="icon icon-delete"></i>
											</a>
											<input type="hidden" value="<?php echo urldecode($_GET['topic_title']); ?>" name="topics[]" />
										</span>
										<?php } ?>

										<?php if ($_POST['topics']) { ?>
										<?php foreach ($_POST['topics'] AS $key => $val) { ?>
										<span class="topic-tag">
											<a class="text"><?php echo $val; ?></a>
											<input type="hidden" value="<?php echo $val; ?>" name="topics[]" />
										</span>
										<?php } ?>
										<?php } ?>

										<span class="aw-edit-topic icon-inverse"><i class="icon icon-edit"></i> <?php e('编辑话题'); ?></span>
										</span>
									</div>
								</div>
								<?php if ($this->recent_topics) { ?>
								<h3><?php e('最近话题'); ?>:</h3>
								<div class="aw-topic-bar">
									<div class="topic-bar clearfix">
										<?php foreach($this->recent_topics as $key => $val) { ?>
										<span class="topic-tag" >
											<a class="text">
												<?php echo $val; ?>
											</a>
										</span>
										<?php } ?>
									</div>
								</div>
								<?php } ?>
								<?php } ?>
								<?php if ($this->human_valid) { ?>
								<div class="aw-auth-img clearfix">
									<input class="form-control pull-right" type="text" name="seccode_verify" placeholder="验证码" />
									<em class="auth-img pull-right"><img src=""  id="captcha"  /></em>
								</div>
								<?php } ?>
							</div>
							<div class="mod-footer clearfix">
								<a href="integral/rule/" target="_blank">[<?php e('积分规则'); ?>]</a>
								<span class="aw-anonymity">
									<?php if ($this->question_info['question_id'] AND ($this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator'])) { ?>
									<label><input type="checkbox" class="pull-left" value="1" name="do_delete" />
										<?php e('删除问题'); ?></label>
									<?php } ?>
									
									<label><input type="checkbox" class="pull-left" value="1" name="anonymous" />
										<?php e('匿名'); ?></label>
									

								</span>
								<input type="hidden" value="{$question_id}" name="id">
								<a class="btn btn-large btn-success btn-publish-submit cmzPost"  >确认发起</a>
							</div>
						</div>
					</form>
				</div>
				<!-- 侧边栏 -->
				<div class="col-sm-12 col-md-3 aw-side-bar hidden-xs">
					<!-- 问题发起指南 -->
					<div class="aw-mod publish-help">
						<div class="mod-head">
							<h3>问题发起指南</h3>
						</div>
						<div class="mod-body">
							<p><b>• 问题标题:</b> 请用准确的语言描述您发布的问题思想</p>
							<p><b>• 问题补充:</b> 详细补充您的问题内容, 并提供一些相关的素材以供参与者更多的了解您所要问题的主题思想</p>
							<p><b>• 选择话题:</b> 选择一个或者多个合适的话题, 让您发布的问题得到更多有相同兴趣的人参与. 所有人可以在您发布问题之后添加和编辑该问题所属的话题</p>
							
							<p><b>• 关于积分：</b>发起一个问题会消耗您 50s 个积分,每多一个回复你将获得50个积分的奖励 为了您的利益, 在发起问题的时候希望能够更好的描述您的问题以及多使用站内搜索功能</b></p>
							
						</div>
					</div>
					<!-- end 问题发起指南 -->
				</div>
				<!-- end 侧边栏 -->
			</div>
		</div>
	</div>
</div>


{include file="public/footer" /}